<template>
  <ul class="todo-main">
    <!-- 使用第三方动画 -->
    <transition-group
      appear
      name="animate__animated animate__bounce"
      enter-active-class="animate__bounceInDown"
      leave-active-class="animate__zoomOutRight"
    >
      <MyItem v-for="todoObj of todos" :key="todoObj.id" :todo="todoObj" />
    </transition-group>
  </ul>
</template>

<script>
import "animate.css";
import MyItem from "./MyItem.vue";

export default {
  name: "MyList",
  components: { MyItem },
  // 使用 props 获取父组件传递过来的数据并挂在 vc 上
  props: ["todos"],
};
</script>
<style scoped>
/*main*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
</style>
